package com.kitty.game.pet.service;

import com.kitty.game.difu.domin.NingshenFieldAdd;
import com.kitty.game.difu.domin.NingshenFieldList;

import java.util.List;
import java.util.Map;

public class PetUtils {

    public static int getEffect(String type, List<NingshenFieldAdd> ningshenFieldAdds){
        int effect =0;
        for (NingshenFieldAdd ningshenFieldAdd : ningshenFieldAdds) {
            List<NingshenFieldList> ningshenFieldListList = ningshenFieldAdd.getNingshenFieldListList();
            for (NingshenFieldList ningshenFieldList : ningshenFieldListList) {
                if(type.equals(ningshenFieldList.getKey())){
                    effect += ningshenFieldList.getValue();
                }
            }
        }
        return effect;
    }

    public static int getPeiYuanAddInfo(String type, Map<String, Integer> addInfo){
        int effect = 0 ;
        if(addInfo.containsKey(type)){
             effect = addInfo.get(type);
        }
        return effect;
    }


}
